<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>科技人物奖申报书</title>
@include('common-css')
<style>
.input_box {
    width: 100%;
    height: 40px;
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.input_label {
    width: 120px;
    box-sizing: border-box;
}

.nav_sub_link.doc_download a {
    display: block;
    color: #666;
}
.common_form_label {
    font-weight: 500 !important;
}
.common_form span, .common_box p, .common_box pre{
    font-size:14px;
}
.common_box pre {
    padding: 5px 0;
    line-height: 1.5;
    white-space:pre-wrap; /* css3.0 */
    white-space:-moz-pre-wrap; /* Firefox */
    white-space:-o-pre-wrap; /* Opera 7 */
    word-wrap:break-word; /* Internet Explorer 5.5+ */
}
.ant-modal-body{
    padding: 16px !important;
}
.ant-table-tbody > tr > td, .ant-table-thead > tr > th {
    vertical-align: middle;
    font-size:13px;
    line-height: 23px;
    padding: 5px !important;
}
.scoring-modal-sum-div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 15px;
}

.scoring-modal-sum-div > span {
    color:#52c41a;
}
</style>
</head>
<body>
<div id="app">

</div>
</body>
</html>

<script id="appTemplate" type="x-template">
<a-locale-provider :locale="antdLocale">
    <div class="container">
        <header class="special">
            <div class="left_info">
                <!-- <img src="/images/icon1.png" alt=""> -->
                <h1>科技人物奖申报书</h1>
            </div>
            <div class="right_user">
                <div class="btn_box">
                    <a-button v-if="scoreFormShowType" type="primary" @click="showAddScoreFormModal(applicationId)">
                        <span v-if="scoreFormShowType == 'create'">评分</span>
                        <span v-else>修改评分</span>
                    </a-button>
                </div>
            </div>
        </header>

        <main>


            <div class="common_container">

                <!-- 侧边栏 -->
                <nav class="common_nav">
                    <div class="nav_title">

                    </div>
                    <div class="nav_content">
                        <div class="nav_link">申报内容</div>
                        <div class="nav_sub_link" v-for="(tab,index) in navBar" :key="index"
                             :class="{'choose':index == currentIndex}" @click="changeBar(index,tab.anchor)">
                            @{{tab.name}}
                        </div>
                    </div>
                </nav>

                <!-- 内容外部容器区域 -->
                <div class="common_content">

                    <!-- 表单填写内容区域 -->
                    <div class="common_box">

                        <h4 class="common_title" id="one">基本信息</h4>

                        <div class="common_form">

                            <div class="common_form_input_3">
                                <div class="common_form_label">姓&emsp;&emsp;名:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.name"></span>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">性&emsp;&emsp;别:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.sex"></span>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">本人照片
                                    <a-tooltip placement="top">
                                        <template slot="title">
                                            <span>一寸登记照</span>
                                        </template>
                                        <a-icon type="info-circle"/>
                                    </a-tooltip>
                                </div>
                                <div class="common_form_box">
                                    <a style="font-size: 14px; margin-right: 10px;" v-if="formData.basic.document_photo" :href="formData.basic.document_photo" target="_blank">查看</a>
                                </div>
                            </div>

                        </div>

                        <div class="common_form">

                            <div class="common_form_input_3">
                                <div class="common_form_label">民&emsp;&emsp;族:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.nation"></span>
                                    </span>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">学&emsp;&emsp;历:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.eduction"></span>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">学&emsp;&emsp;位:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.degree"></span>
                                </div>
                            </div>

                        </div>

                        <div class="common_form">

                            <div class="common_form_input_3">
                                <div class="common_form_label">党&emsp;&emsp;派:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.groups"></span>
                                </div>
                            </div>


                            <div class="common_form_input_3">
                                <div class="common_form_label">出生日期:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.birth"></span>
                                </div>
                            </div>

                            <div class="common_form_input_3">
                                <div class="common_form_label">毕业时间:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.graduate"></span>
                                </div>
                            </div>


                        </div>

                        <div class="common_form">

                            <div class="common_form_input_3">
                                <div class="common_form_label">专业技术职务:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.professional"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label">行政职务:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.duty"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label"></div>
                                <div class="common_form_box">
                                </div>
                            </div>
                        </div>

                        <div class="common_form">

                            <div class="common_form_input_3">
                                <div class="common_form_label">E-mail:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.mail"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label">手机号码:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.phone">
                                    </span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label"></div>
                                <div class="common_form_box">
                                </div>
                            </div>
                        </div>

                        <div class="common_form">
                            <div class="common_form_input_3">
                                <div class="common_form_label">工作单位全称:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.company"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label">单位电话:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.company_phone"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label"></div>
                                <div class="common_form_box">
                                </div>
                            </div>
                        </div>
                        <div class="common_form">
                            <div class="common_form_input_3">
                                <div class="common_form_label">单位地址:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.company_address"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label">邮&emsp;&emsp;编:</div>
                                <div class="common_form_box">
                                    <span v-html="formData.basic.company_email"></span>
                                </div>
                            </div>
                            <div class="common_form_input_3">
                                <div class="common_form_label"></div>
                                <div class="common_form_box">
                                </div>
                            </div>
                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">社会职务:</div>
                                <div class="common_form_box">
                                    <pre v-html="formData.basic.job"></pre>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_label">国内外学术组织任职情况:</div>
                                <div class="common_form_box">
                                    <pre v-html="formData.basic.situation"></pre>
                                </div>
                            </div>

                        </div>

                        <div class="common_form_table">

                            <div class="common_form_input_1">
                                <div class="common_form_label">本人简历（从高校填起）</div>
                                <div class="common_form_box">

                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>起止年月</th>
                                            <th>所在单位(学校)</th>
                                            <th>职务(专业)</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.basic.resume" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td>
                                                <span v-html="record.range"></span>
                                            <td>
                                                <span v-html="record.address"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.experience"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="two">所获科技奖励和荣誉称号情况</h4>
                        <div class="common_form_table">
                            <div class="common_form_input_1">
                                <div class="common_form_box">

                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>奖励或荣誉名称</th>
                                            <th>授奖单位</th>
                                            <th>授奖日期</th>
                                            <th>获奖总人数</th>
                                            <th>本人排名</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.award" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td>
                                                <span v-html="record.award_name"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.company_of_issue"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.date"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.total"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.rank"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="three">发表论文及专著情况</h4>
                        <div class="common_form_table">
                            <div class="common_form_input_1">
                                <div class="common_form_box">

                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>论文/著作<br />名称</th>
                                            <th>年份</th>
                                            <th>本人排名</th>
                                            <th>主要合作者</th>
                                            <th>发表刊物<br />或出版社名称</th>
                                            <th>本人作用<br />或主要贡献(限100字)</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.paper" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td width="200">
                                                <span v-html="record.paper_name"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.date"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.rank"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.partner"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.publish"></span>
                                            </td>
                                            <td width="400">
                                                <span v-html="record.contribution"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="four">所获知识产权证书</h4>
                        <div class="common_form_table">
                            <div class="common_form_input_1">
                                <div class="common_form_box">

                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>知识产权<br />类别</th>
                                            <th>授权项目<br />名称</th>
                                            <th>国(区)别</th>
                                            <th>授权号</th>
                                            <th>授权日期</th>
                                            <th>证书编号</th>
                                            <th>权利人</th>
                                            <th>发明人</th>
                                            <th>所对应<br />标志性成果</th>
                                            <th>证明材料<br />编号</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.property" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td width="80">
                                                <span v-html="record.property_category"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.item_name"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.country"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.authorization_num"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.authorization_date"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.certificate_number"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.obligee"></span>
                                            </td>

                                            <td>
                                                <span v-html="record.inventor"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.achievement"></span>
                                            </td>
                                            <td width="80">
                                                <span v-html="record.reference_number"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                </div>
                            </div>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="five">承担科研项目情况</h4>
                        <div class="common_form_table">
                            <div class="common_form_input_1">
                                <div class="common_form_box">

                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>项目名称</th>
                                            <th>研发经费(万)</th>
                                            <th>项目来源</th>
                                            <th>项目编号</th>
                                            <th>研发起止时间</th>
                                            <th>状态</th>
                                            <th>负责人</th>
                                            <th>本人在项目<br />成果中排序</th>
                                            <th>证明材料<br />编号</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.scientific" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td>
                                                <span v-html="record.project_name"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.expenditure"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.project_origin"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.project_number"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.development_date"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.status"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.principal"></span>
                                            </td>

                                            <td>
                                                <span v-html="record.sort"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.reference_number"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="six">参与重大工程科技项目情况</h4>
                        <div class="common_form_table">
                            <div class="common_form_input_1">
                                <div class="common_form_box">


                                    <table class="form-data-table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>项目名称</th>
                                            <th>项目委托单位</th>
                                            <th>本人参与情况</th>
                                            <th>经济效益(万元)</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="(record, index) in formData.engineering" :key="index">
                                            <td>@{{ index + 1 }}</td>
                                            <td>
                                                <span v-html="record.project_name"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.issue_company"></span>
                                            </td>

                                            <td>
                                                <span v-html="record.aboutme"></span>
                                            </td>
                                            <td>
                                                <span v-html="record.economic"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>

                                </div>
                            </div>
                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="seven">科技成果转化及推广情况</h4>
                        <div class="common_form_area">

                            <div class="common_form_input_1">
                                <div class="common_form_box">
                                    <pre v-html="formData.situation"></pre>
                                </div>
                            </div>

                        </div>
                        <!-- 分割线 -->
                        <div class="hr"></div>

                        <h4 class="common_title" id="eight">附件</h4>
                        <table class="form-attachments-table">
                            <tr v-for="(attachmentItem,index) in attachmentItems" :key="index">
                                <td>@{{ index + 1 }}.</td>
                                <td>@{{ attachmentItem.name }}</td>
                                <td class="operations">
                                    <span v-if="formData.attachments[attachmentItem.key]">
                                        <a :href="formData.attachments[attachmentItem.key]" target="_blank">查看</a>
                                    </span>
                                    <span v-else>无</span>
                                </td>
                            </tr>
                        </table>

                    </div>

                </div>

            </div>

        </main>
        <a-modal
                :width="1200"
                v-model="scoringFormInfo.scoreDialogVisible"
                title="评分表"
                @cancel="closeScoreFromModel"
                :footer="null"
        >
            <div class="scoring-modal-sum-div">
                <span>
                    <a-alert message="评分在提交之前可修改" type="info" showIcon banner/>
                </span>
                <span>
                    <span style="margin-right: 46px">总得分：<span>@{{ now_score }}</span></span>
                    <a-button type="primary" @click="submitScoreFormModel">
                        保&ensp;存
                    </a-button>
                </span>
            </div>
            <a-table class="application-list"
                     size="small"
                     rowKey="key"
                     :columns="scoringFormInfo.scoreTableListColumns"
                     :dataSource="scoringFormInfo.formData"
                     :pagination="false">
                <span slot="evaluation_index" slot-scope="text, record">
                    <h3 style="font-weight: bold; color: #666;">@{{ record.evaluation_index }}</h3>
                    <p v-if="record.evaluation_index_meaning" style="font-size: 12px; color: #666; margin-top: 10px;">
                        @{{ record.evaluation_index_meaning }}
                    </p>
                </span>
                <p slot="method_of_marking" slot-scope="text, record" v-html="record.method_of_marking"></p>
                <span slot="real_score" slot-scope="text, record">
                    <a-input-number :min="0" :max="record.standard_score" v-model="record.real_score"></a-input-number>
                </span>
                <span slot="remarks" slot-scope="text, record">
                    <a-textarea v-model="record.remarks"></a-textarea>
                </span>
            </a-table>
        </a-modal>
    </div>

</a-locale-provider>
</script>

@include('common-js')

<script>
var applicationId = {{ Request::get('id') }};
var expertId = {!! $user->id !!}
var scoreFormShowType = '{!! $type !!}'
var formData = {!! json_encode($formData, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) !!};
var application = {!! json_encode($application, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) !!};
console.log(application)
const scoreTableListColumns = [
    {
        width: 370,
        title: '评价指标',
        dataIndex: 'evaluation_index',
        scopedSlots: {
            customRender: 'evaluation_index'
        }
    },
    // {
    //     width: 330,
    //     title: '指标含义',
    //     dataIndex: 'evaluation_index_meaning',
    //     scopedSlots: {
    //         customRender: 'evaluation_index_meaning'
    //     }
    // },
    {
        width: 520,
        title: '评分方法及标准',
        dataIndex: 'method_of_marking',
        scopedSlots: {
            customRender: 'method_of_marking'
        }
    }, {
        width: 60,
        title: '标准分',
        dataIndex: 'standard_score',
        scopedSlots: {
            customRender: 'standard_score'
        }
    }, {
        width: 60,
        title: '实得分',
        dataIndex: 'real_score',
        scopedSlots: {
            customRender: 'real_score'
        }
    }, {
        width: 90,
        title: '备注',
        dataIndex: 'remarks',
        scopedSlots: {
            customRender: 'remarks'
        }
    }];
Vue.prototype.$axios = axios
var app = new Vue({
    el: '#app',
    template: '#appTemplate',
    data: {
        scoreFormShowType: scoreFormShowType,
        formData: {
            type: 'talent', //科技人物奖
            // 基本信息
            basic: {
                name: '', //姓名
                sex: '男', //性别 0 女， 1 男
                document_photo: '', //证件照
                nation: '', //民族
                eduction: '', //学历
                groups: '', //党派
                degree: '', //学位
                birth: '', //出生日期
                duty: '', //行政职务
                professional: '', //专业技术职务
                phone: '', //手机号码
                graduate: '', //毕业时间
                company_phone: '', //单位电话
                mail: '', //e-mail
                company: '', //工作单温名称
                company_address: '', //工作单位地址
                company_email: '', //工作单位邮编
                job: '', //社会职务
                situation: '', //国内外学术组织任职情况
                resume: [] //本人简历

            },
            award: [], //所获科技奖励和荣誉称号情况
            paper: [], //发表论文及专著情况
            property: [], //所获知识产权证书
            scientific: [], //承担科研项目情况
            engineering: [], //参与重大工程科技项目情况
            situation: '', //科技成果转化及推广情况,
            attachments: {
                commitment_letter:null,
                tech_awards: null,
                publications: null,
                ip_certs: null,
                project_files: null,
                benefit_certs: null,
                recommend_letter: null,
                others: null
            }
        },
        attachmentItems: [
            {
                name: '承诺函 PDF 扫描件（模板见左侧资料下载）',
                key: 'commitment_letter',
                accept_upload_type: 'pdf',
            },
            {
                name: '推荐函 PDF 扫描件 (需加盖推荐单位公章)',
                accept_upload_type: 'pdf',
                key: 'recommend_letter'
            },
            {
                accept_upload_type: 'all',
                name: '科技奖励和荣誉称号证书或文件',
                key: 'tech_awards'
            },
            {
                name: '代表性论文、专著(不超过5篇)',
                accept_upload_type: 'all',
                key: 'publications'
            },
            {
                name: '所获知识产权证书',
                accept_upload_type: 'all',
                key: 'ip_certs'
            },
            {
                name: '承担科研项目立项或验收文件',
                accept_upload_type: 'all',
                key: 'project_files'
            },
            {
                name: '效益证明',
                accept_upload_type: 'all',
                key: 'benefit_certs'
            },
            {
                name: '其他证明或补充材料',
                accept_upload_type: 'all',
                key: 'others'
            }
        ],
        ipTypes: ['发明专利', '外观', '实用新型', '标准', '软件著作权', '集成电路布图设计', '其它'],
        arrayElementDefs: {
            resume: { //本人简历填写项
                range: '', //起止年月
                address: '', //所在单位
                experience: '' //职务
            },
            award: { //获奖及荣誉填写项
                date: '', //授奖日期
                total: '', //总人数
                rank: '', //个人排名
                company_of_issue: '', //授奖单位
                award_name: '' //奖名
            },
            paper: { //发表论文及专著情况填写
                paper_name: '', //论文名
                date: '', //年份
                partner: '', //合作者
                rank: '', //本人排名
                publish: '', //发表出版社
                contribution: '' //个人贡献
            },
            property: { //知识产权
                property_category: '', //类别
                item_name: '', //名称
                country: '', //国家
                authorization_num: '', //授权号
                authorization_date: '', //授权日期
                certificate_number: '', //证书号码
                obligee: '', //权利人
                inventor: '', //发明人
                achievement: '', //成果
                reference_number: '' //证书材料编号
            },
            scientific: { //承担科研项目情况
                project_name: '', //项目名称
                development_date: '', //研发起止时间
                expenditure: '', //研发经费
                project_origin: '', //项目来源
                project_number: '', //项目编号
                status: '在研',
                principal: '', //负责人
                sort: '', //个人排序
                reference_number: '', //证明材料编号
            },
            engineering: { //重大工程及项目情况
                project_name: '', //项目名称
                issue_company: '', //委托单位
                aboutme: '', //个人参与情况
                economic: '' //经济效益
            }
        },
        navBar: [
            {
            name: '基本信息',
            anchor: 'one'
            },
            {
                name: '所获科技奖励和荣誉称号情况',
                anchor: 'two'
            },
            {
                name: '发表论文和专著情况',
                anchor: 'three'
            },
            {
                name: '所获知识产权证书',
                anchor: 'four'
            },
            {
                name: '承担科研项目情况',
                anchor: 'five'
            },
            {
                name: '参与重大工程技术项目情况',
                anchor: 'six'
            },
            {
                name: '科技成果转化及推广情况',
                anchor: 'seven'
            },
            {
                name: '附件',
                anchor: 'eight'
            }
        ],
        currentIndex: 0,
        applicationId: applicationId,
        savingFormData: false,
        antdLocale: antd.locales.zh_CN,
        talentScoreFormInfo: [
            {
                key: '1',
                evaluation_index: '所获科技奖励',
                evaluation_index_meaning: '',
                method_of_marking: '（1）近五年，作为主要完成人获得公路行业国家级科学技术奖一项及以上得25分<br>（2）近五年，作为主要完成人获得公路行业部级、省级或社会力量科学技术奖（入选国家奖励办奖励目录的）3项得10分（少于3项不得分），多一项加5分，最多得25分<br>（3）近五年，作为主要完成人参编已发布的国家标准、行业标准、团体标准3项得10分（少于3项不得分），多1项加5分，最多得25分<br>（4）近五年，作为主要完成人获得公路工程工法5项得10分（少于5项不得分），多1项加3分，公路行业国家级工法多1项加5分，最多得25分',
                standard_score: 25,
                real_score: '',
                remarks: ''
            },
            {
                key: '2',
                evaluation_index: '所获个人荣誉',
                evaluation_index_meaning: '',
                method_of_marking: '（1）获得国家级荣誉（如国家级人才计划、国务院政府津贴等）得10分<br>（2）获得部级荣誉（如省级人才计划、省级政府津贴等）得5分',
                standard_score: 10,
                real_score: '',
                remarks: ''
            },
            {
                key: '3',
                evaluation_index: '发表论文和专著',
                evaluation_index_meaning: '',
                method_of_marking: '（1）一级出版社出版专著1部及以上得10分<br>（2）SCI、EI收录论文，排名第一或独著的1篇得5分，排名第二的1篇得2分，最多得10分<br>（3）核心期刊发表论文，排名第一或独著的一篇得2分，排名第二的1篇得1分，最多得10分',
                standard_score: 10,
                real_score: '',
                remarks: ''
            },
            {
                key: '4',
                evaluation_index: '所获知识产权证书',
                evaluation_index_meaning: '',
                method_of_marking: '（1）作为第一发明人，获授权发明专利1项得10分<br>（2）作为第二发明人，获授权发明专利1项得5分，最多得10分<br>（3）作为第三发明人，获授权发明专利1项得2分，最多得10分',
                standard_score: 10,
                real_score: '',
                remarks: ''
            },
            {
                key: '5',
                evaluation_index: '主持科研项目情况',
                evaluation_index_meaning: '',
                method_of_marking: '（1）作为主要完成人参与国家级科研项目1项及以上得15分（排名前3）<br>（2）作为主要完成人参与省部级科研项目1项得5分，最多得15分（排名前3）',
                standard_score: 15,
                real_score: '',
                remarks: ''
            },
            {
                key: '6',
                evaluation_index: '参与重大工程技术项目情况',
                evaluation_index_meaning: '',
                method_of_marking: '（1）参与重大工程技术项目（10亿及以上）1项及以上，且技术经济效益不少于3000万，得  15分<br>（2）参与重大工程技术项目（5亿及以上），且技术经济效益不少于2000万，每1项得5分，最多得15分<br>（3）参与重大工程技术项目（3亿及以上），且技术经济效益不少于1000万，每1项得3分，最多得15分',
                standard_score: 15,
                real_score: '',
                remarks: ''
            },
            {
                key: '7',
                evaluation_index: '科技成果推广应用',
                evaluation_index_meaning: '',
                method_of_marking: '每推广一项先进技术的成功应用，得5分，最多得15分',
                standard_score: 15,
                real_score: '',
                remarks: ''
            },
        ],
        scoringFormInfo: {
            id: '',
            award_id: '',
            award_type_id: 2,
            scoreDialogVisible: false,
            scoreTableListColumns: scoreTableListColumns,
            formData: [],
            score: 0,
            show_type: '',
        },
        expertId: expertId,
        application: application

    },
    mounted() {
        copyFieldValueFromObject(this.$data.formData, formData, this.arrayElementDefs)
    },
    computed: {
        now_score: {
            get: function () {
                let score = 0
                this.scoringFormInfo.formData.forEach( item => {
                    let tmp = item.real_score == '' || item.real_score == undefined ? 0 : parseFloat(item.real_score)
                    score += tmp
                })
                return score
            },
            set: function () {
                return 0
            }
        },
    },
    methods: {
        closeScoreFromModel() {
            this.scoringFormInfo.formData = []
            this.scoringFormInfo.award__id = ''
            this.scoringFormInfo.show_type = ''
            this.scoringFormInfo.id = ''
            this.now_score = 0
            this.scoringFormInfo.scoreDialogVisible = false
        },
        submitScoreFormModel() {
            let _this = this
            let {formData, award_id, score, show_type, id, award_type_id} = this.scoringFormInfo
            let hasError = false
            let errorMeg = ''
            formData.forEach(item => {
                if (item.real_score == '') {
                    hasError = true
                    errorMeg = item.evaluation_index + '未填写分数'
                    return false
                }
                score += item.real_score
            })
            if (hasError) {
                megError(errorMeg)
                errorMeg = ''
                hasError = false
                return false
            }
            _this.$message.info('正在保存...')
            let url = '/api/db/create'
            let records = [
                {
                    expert_id: _this.expertId,
                    application_id: award_id,
                    form_data: JSON.stringify(formData),
                    score
                }
            ]
            if (show_type == 'edit') {
                url = '/api/db/update'
                records = [
                    {
                        id,
                        expert_id: _this.expertId,
                        application_id: award_id,
                        form_data: JSON.stringify(formData),
                        score
                    }
                ]
            }
            console.log('records', records)
            axios.post(url, {
                model: 'ExpertScoringApplicationRelations',
                records
            }).then(res => {
                megDestroy()
                if (res.data.ok) {
                    _this.$message.success('保存成功')
                    _this.scoringFormInfo.scoreDialogVisible = false
                    // history.go(0)
                } else {
                    megError(res.data.message)
                    return false
                }
            })
        },
        showAddScoreFormModal(award_id) {
            this.scoringFormInfo.award_id = award_id
            if (this.application.form_data) {
                console.log('评分过')
                this.scoringFormInfo.formData = JSON.parse(this.application.form_data)
                this.scoringFormInfo.show_type = 'edit'
                this.now_score = this.application.score
                this.scoringFormInfo.id = this.application.relation_id
            } else {
                this.scoringFormInfo.formData = this.talentScoreFormInfo
                this.scoringFormInfo.show_type = 'create'
            }
            this.scoringFormInfo.show_type = 'create'
            this.scoringFormInfo.scoreDialogVisible = true
        },
        completePeopleEdit (targetKey, action) {
            this[action+'CompletePeople'](targetKey)
        },
        changeBar(index, anchorName) {
            this.currentIndex = index
            document.querySelector(`#${anchorName}`).scrollIntoView()
        },
    }
})
</script>